import { IFeidaoAiNodejsComponent } from '@dfeidao/atom-nodejs/interfaces';
import nodejs from '@dfeidao/atom-nodejs/msg/nodejs';
import render from '@dfeidao/atom-nodejs/render/render';
import p001 from './p001';
import p002 from './p002';
import p003 from './p003';
import p004 from './p004';
import p005 from './p005';




export default async function na001(fd: IFeidaoAiNodejsComponent) {
	// 页面初始化
	const ret = await nodejs<{dt: Array<{staff_no: string}>,c: string}>(fd.data.actionid,fd.data.sessionid,'staff-management/zj-000001/s001',{filter:{pn:1}});
	 const res = await nodejs<{dt: Array<{}>,dp: Array<{}>}>(fd.data.actionid,fd.data.sessionid,'staff-management/zj-000001/s003',{});
	 render(fd.data.node,res.dt,p004,'p004');// 渲染担任职务下拉框
	 render(fd.data.node,res.dp,p005,'p005');// 渲染部门下拉框
	 if (ret.dt.length > 0) {
		render(fd.data.node,ret.dt,p001,'p001');
		render(fd.data.node,ret.dt.length,p003,'p003');
	 } else {
		render(fd.data.node,"",p002,'p002');
	 }
}
